import type {
  LoginType,
  UserResult,
  VerifyResult,
  ResultRoute,
  UserInfoItem,
  WarehouseItem
} from "./index.d";
import { http } from "@/utils/http";
/** 登录 */
export const login = (data: LoginType) => {
  return http.request<UserResult>("post", "/customer/loginV3", { data });
};
/** 获取验证码 */
export const getVerify = () => {
  return http.request<VerifyResult>("get", "/customer/verify");
};
/** 动态路由 */
export const getAsyncRoutes = () => {
  return http.request<ResultRoute[]>("get", "/customer/user/menusV3");
};
/**获取用户信息 */
export const getUserInfo = (params?: object) => {
  return http.request<UserInfoItem>("get", "/customer/user/getInfoV2", {
    params
  });
};
/** 仓库 */
export const getWarehouseList = (params?: object) => {
  return http.request<{ list: WarehouseItem[] }>(
    "get",
    "/customer/store/warehouseV2",
    {
      params
    }
  );
};
